Hi..
I use KFLOP + KANALOG + KONNECT to replace the controller on my old CNC's lathe. This lathe has turret with 10 Tool's Slot.
I want to run Automatic Toll Changer with command M6 Tx (x = number of tool). The turret works by hydraulic, to turn it only require one output (bit 150) that will enables the hydraulic's solenoid valve. A solenoid valve will move the plate to unclamp-> turning to no. tool destination-> clamp. The hydraulic mechanism allows only one-way rotation.
On the back of the turret, there is rotary encoder (2500 pulse/rotation), supposed for detect the position when the turret was turning, I connect the A signal to Input bit 1054 and B signal to Input bit 1055.
There is one switch on the back of the turret for detect when the plate on 'clamp' position, I connect the switch to Input bit 1051
The working order of the Automatic Tool changer is as follows:
- M6 Tx commands from Gcode program or MDI
- Axis X and Axis Z move back toward a safe position
- Output bit 150 ON
- Wait time for t second -> t corresponds to the moving distance from the current tool to the destination tool. The time required for clamp and unclamp 0.5s and time required for turn each slot is 0.2 second. For example, to change from tool #1 to tool #3, the total time required will be 0.9s.
- Output bit 150 OFF
- Axis X and Axis Z move forward to continue the next program.
I also want KFLOP to remember the last position of tool's number that's used when the machine is turned on after it is turned off.
Please help me the example of C program to do the above work.
Sorry, I'm just an electrician, and just learned about the C program.
Really very grateful for your help.
Regards,
asmec